package com.example.kehoobackend.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.kehoobackend.common.CommonResponse;
import com.example.kehoobackend.domain.Question;

import java.util.List;

public interface QuestionService extends IService<Question> {

    //删除问题
    boolean deleteQuestion(Integer question_id);

    //添加问题
    Question addQuestion(Question question, List<Integer> topic_ids);

    //查询某话题下的所有问题
    CommonResponse<List<Question>> getQuestionByTopicId(Integer current_id,Integer topic_id);

    //查询所有问题
    CommonResponse<List<Question>> getAllQuestion(Integer current_id);

    //通过关键字搜索问题
    CommonResponse<List<Question>> getQuestionByKeyword(Integer current_id,String keyword);

    //为主页提供问题
    CommonResponse<List<Question>> getQuestionForHome(Integer current_id,String order_type, Integer start, Integer limit);

    //查询用户关注的问题
    CommonResponse<List<Question>> getQuestionForCollect(Integer current_id,String order_type, Integer user_id, Integer start, Integer limit);

    //按点赞降序查询问题
    CommonResponse<List<Question>> getQuestionByLikeDesc(Integer current_id,Integer start, Integer limit);

    //查询某用户提出的问题
    CommonResponse<List<Question>> getQuestionByUserId(Integer user_id);

    //点赞问题
    boolean like(Integer question_id,Integer user_id);

    //取消点赞
    boolean cancelLike(Integer question_id,Integer user_id);

    //某用户是否已点赞某问题
    boolean isLike(Integer question_id, Integer user_id);

    //由问题ID获取详情
    CommonResponse<Question> getQuestionDetail(Integer question_id);

    Integer getUserIdByQuestionId(Integer question_id);

    CommonResponse<List<Question>> getAllQuestion1();
}
